<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@include file="../common/CheckLoginBackend.jsp" %>
<c:set value="${pageContext.request.contextPath}" var="ctx" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="../statics/css/style.css" />
<script type="text/javascript" src="../statics/js/jquery.js"></script>
<script type="text/javascript">
	var contextPath = "${ctx}";
	function fan(pageNo) {
		window.location.href = "ProductListServlet?action=pageShow&pageNo="
				+ pageNo;
	}
	function del(id) {
		var flag = window.confirm("确定要删除吗？");
		if (flag) {
			window.location.href = "ProductListServlet?action=del&id=" + id;
		}
	}
</script>
<title>二组牛逼</title>
</head>
<body>
	<%@include file="../common/Admin_Header.jsp"%>
	<div class="i_bg bg_color">
		<!--Begin 用户中心 Begin -->
		<div class="m_content">
			<%@include file="../common/Admin_left.jsp"%>
			<div class="m_right" id="content">
				<div class="mem_tit">商品列表</div>
				<br>
				<table border="0" class="order_tab"
					style="width:930px; text-align:center; margin-bottom:30px;"
					cellspacing="0" cellpadding="0">
					<tbody>
						<tr>
							<td width="10%">商品名称</td>
							<td width="10%">商品图片</td>
							<td width="5%">库存</td>
							<td width="10%">价格</td>
							<td width="10%" colspan="2">操作</td>
						</tr>
						<c:forEach items="${page.list}" var="p" varStatus="v">
							<tr>
								<td>${p.name}</td>
								<td><a href="" target="_blank"> <img
										src="../statics/productImg/${p.fileName}" width="50"
										height="50" /> </a></td>
								<td>${p.stock}</td>
								<td>${p.price}</td>
								<td><a href="ProductListServlet?action=update&id=${p.id}">修改</a>
								</td>
								<td><a href="javascript:del(${p.id})">删除</a>
								</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<!-- 分页 -->
				<%@include file="../common/Page.jsp"%>
			</div>
		</div>
	</div>
	<%@include file="../common/footer.jsp"%>
</body>
</html>
